package main

import "fmt"

func main() {

	//切片
	slice := []int{0, 1, 2, 3}
	m := make(map[int]*int)

	//for range 循环的时候会创建每个元素的副本
	for key, val := range slice {
		m[key] = &val //全是地址，循环到最后都是最后一个元素的地址
	}

	//0 -> 3
	//1 -> 3
	//2 -> 3
	//3 -> 3
	for k, v := range m {
		fmt.Println(k, "->", *v)
	}
}
